include io.asm

stack segment stack
	dw 128 dup (?)
stack ends

;;======================================================================
data segment
	Head db "Vasilenko Anatoly. Group 111.$"
	Input db "Enter please numbers P and Q: $"
	Output db "P/Q = $"
	P dw ?;
	Q dw ?;
data ends
;;======================================================================

code segment 'code'
	assume ss:stack, ds:data, cs:code
start:
	mov ax,data
	mov ds,ax
	lea dx, Head
	outstr
	newline
	newline
	;;------------------------------------------------------------------
		lea dx, Input;
		outstr;
		
		inint P;
		inint Q;
		
		lea dx, Output;
		outstr;
		
		mov ax, P;
		mov dx, 0;
		div Q;		
		outword ax;
		
		outch '.';
		
		mov bx, 10;
		mov cx, 5;
		L:	mov ax, dx;
			mul bx;
			div Q;
			outword ax;
			loop L;
	
	;;------------------------------------------------------------------

the_end:
	newline;
	newline;
	mov ah,8
	int 21h
    finish
code ends

;;======================================================================
end start 

;;======================================================================
